<{include file="header.html"}>
<{include file="top.html"}>
<div class="h_980 clearfix">
            <div class="FosfMain">
            <div id="checkoutShipAddressDefault">
            <div class="page_dh"><a class="location-home" href="<{spUrl c=main a=index}>"></a> <a href="<{spUrl c=main a=CheckoutShipping}>"><{T w='Checkout'}></a> <{T w='NavigationJGF'}><{T w='Change Shipping Address'}></div>

            <script language="javascript" type="text/javascript"><!--
            
            
            
              function hideStateField(theForm) {
                theForm.state.disabled = true;
                theForm.state.className = 'hiddenField';
                theForm.state.setAttribute('className', 'hiddenField');
                document.getElementById("stateLabel").className = 'hiddenField';
                document.getElementById("stateLabel").setAttribute('className', 'hiddenField');
                document.getElementById("stText").className = 'hiddenField';
                document.getElementById("stText").setAttribute('className', 'hiddenField');
                document.getElementById("stBreak").className = 'hiddenField';
                document.getElementById("stBreak").setAttribute('className', 'hiddenField');
              }
            
              function showStateField(theForm) {
                theForm.state.disabled = false;
                theForm.state.className = 'inputLabel visibleField';
                theForm.state.setAttribute('className', 'visibleField');
                document.getElementById("stateLabel").className = 'inputLabel visibleField';
                document.getElementById("stateLabel").setAttribute('className', 'inputLabel visibleField');
                document.getElementById("stText").className = 'alert visibleField';
                document.getElementById("stText").setAttribute('className', 'alert visibleField');
                document.getElementById("stBreak").className = 'clear visibleField';
                document.getElementById("stBreak").setAttribute('className', 'clear visibleField');
              }
            //--></script>
            <script language="javascript" type="text/javascript"><!--
            var selected;
            
            function check_form_optional(form_name) {
              var form = form_name;
                if (!form.elements['firstname']) {
                return true;
              } else {
                var firstname = form.elements['firstname'].value;
                var lastname = form.elements['lastname'].value;
                var street_address = form.elements['street_address'].value;
            
                if (firstname == '' && lastname == '' && street_address == '') {
                  return true;
                } else {
                  return check_form(form_name);
                }
              }
            }}
            var form = "";
            var submitted = false;
            var error = false;
            var error_message = "";
            
            function check_input(field_name, field_size, message) {
              if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
                if (field_size == 0) return;
                var field_value = form.elements[field_name].value;
            
                if (field_value == '' || field_value.length < field_size) {
                  error_message = error_message + "* " + message + "\n";
                  error = true;
                }
              }
            }
            
            function check_radio(field_name, message) {
              var isChecked = false;
            
              if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
                var radio = form.elements[field_name];
            
                for (var i=0; i<radio.length; i++) {
                  if (radio[i].checked == true) {
                    isChecked = true;
                    break;
                  }
                }
            
                if (isChecked == false) {
                  error_message = error_message + "* " + message + "\n";
                  error = true;
                }
              }
            }
            
            function check_select(field_name, field_default, message) {
              if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
                var field_value = form.elements[field_name].value;
            
                if (field_value == field_default) {
                  error_message = error_message + "* " + message + "\n";
                  error = true;
                }
              }
            }
            
            function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {
              if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
                var password = form.elements[field_name_1].value;
                var confirmation = form.elements[field_name_2].value;
            
                if (password == '' || password.length < field_size) {
                  error_message = error_message + "* " + message_1 + "\n";
                  error = true;
                } else if (password != confirmation) {
                  error_message = error_message + "* " + message_2 + "\n";
                  error = true;
                }
              }
            }
            
            function check_password_new(field_name_1, field_name_2, field_name_3, field_size, message_1, message_2, message_3) {
              if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
                var password_current = form.elements[field_name_1].value;
                var password_new = form.elements[field_name_2].value;
                var password_confirmation = form.elements[field_name_3].value;
            
                if (password_current == '' ) {
                  error_message = error_message + "* " + message_1 + "\n";
                  error = true;
                } else if (password_new == '' || password_new.length < field_size) {
                  error_message = error_message + "* " + message_2 + "\n";
                  error = true;
                } else if (password_new != password_confirmation) {
                  error_message = error_message + "* " + message_3 + "\n";
                  error = true;
                }
              }
            }
            
            function check_state(min_length, min_message, select_message) {
              if (form.elements["state"] && form.elements["zone_id"]) {
                if (!form.state.disabled && form.zone_id.value == "") check_input("state", min_length, min_message);
              } else if (form.elements["state"] && form.elements["state"].type != "hidden" && form.state.disabled) {
                check_select("zone_id", "", select_message);
              }
            }
            
            function check_form(form_name) {
              if (submitted == true) {
                alert("This form has already been submitted. Please press OK and wait for this process to be completed.");
                return false;
              }
            
              error = false;
              form = form_name;
              error_message = "Errors have occurred during the processing of your form.\n\nPlease make the following corrections:\n\n";
            
              error = false;
              form = form_name;
              error_message = "<{T w='Errors have occurred during the processing of your form.\n\nPlease make the following corrections:\n\n'}>";
            
              check_input("firstname", 2, "<{T w='Is your first name correct? Our system requires a minimum of 2 characters. Please try again.'}>");
              check_input("lastname", 2, "<{T w='Is your last name correct? Our system requires a minimum of 2 characters. Please try again.'}>");
            
              check_input("email_address", 6, "<{T w='Is your email address correct? It should contain at least 6 characters. Please try again.'}>");
              check_input("street_address", 5, "<{T w='Your Street Address must contain a minimum of 5 characters.'}>");
              check_input("postcode", 4, "<{T w='Your Post/ZIP Code must contain a minimum of 4 characters.'}>");
              check_input("city", 2, "<{T w='Your City must contain a minimum of 2 characters.'}>");
              check_state(2, "<{T w='Your State must contain a minimum of 2 characters.'}>", "Please select a state from the States pull down menu.'}>");
            
              check_select("country", "", "<{T w='You must select a country from the Countries pull down menu.'}>");
            
              check_input("telephone", 3, "<{T w='Your Telephone Number must contain a minimum of 3 characters.'}>");
            
              if (error == true) {
                alert(error_message);
                return false;
              } else {
                submitted = true;
                return true;
              }
            }
            //--></script>
            <form name="checkout_address" action="<{spUrl c=main a=CheckoutShippingAddress}>" method="post" onsubmit="return check_form_optional(checkout_address);">
            <h1 id="checkoutShipAddressDefaultHeading"><{T w='Change the Shipping Address'}></h1>
            <input type="hidden" name="address_book_id" value="<{$add.address_book_id}>" id="address_book_id" />
            
            
            <h2 id="checkoutShipAddressDefaultAddress"><{T w='Current Shipping Address'}></h2>
            <address><{$add.customers_firstname}> <{$add.customers_lastname}><br /> <{$add.entry_street_address}><{if $add.entry_suburb neq ''}><br /> <{$add.entry_suburb}><{/if}> <br /> <{$add.entry_city}>, <{$add.entry_postcode}><br /> <{$add.entry_state}>, <{$add.entry_country_id2}></address>
            <div class="important"><{T w='Current Shipping AddressTIP'}></div>
            <br class="clear" />
            
            <div class="centerColumnModule" id="checkoutNewAddress">
            <fieldset>
            <legend><{T w='Change the Shipping Address for This Order'}></legend>
            <div class="alert"><{T w='* Required information'}></div>
            
            <label class="inputLabel" for="firstname"><{T w='First Name'}>:</label>
            <input type="text" name="firstname" value="<{$add.customers_firstname}>" size = "33" maxlength = "32" id="firstname" /><span class="alert">*</span><br class="clear" />
            <label class="inputLabel" for="firstname"><{T w='Last Name'}>:</label>
            <input type="text" name="lastname" value="<{$add.customers_lastname}>" size = "33" maxlength = "32" id="lastname" /><span class="alert">*</span><br class="clear" />
            
            <label class="inputLabel" for="street-address"><{T w='Street Address'}>:</label>
              <input type="text" name="street_address" size = "41" maxlength= "64" id="street-address" value="<{$add.entry_street_address}>" /><span class="alert">*</span><br class="clear" />
            
            <label class="inputLabel" for="suburb"><{T w='Address Line 2'}>:</label>
            <input type="text" name="suburb" size = "33" maxlength = "32" id="suburb" value="<{$add.entry_suburb}>" /><br class="clear" />
            
            <label class="inputLabel" for="city"><{T w='City'}>:</label>
            <input type="text" name="city" size = "33" maxlength = "32" id="city" value="<{$add.entry_city}>" /><span class="alert">*</span><br class="clear" />
            
            
            <label class="inputLabel" for="state" id="stateLabel"><{T w='State/Province'}>:</label>
            <input type="text" name="state" value="<{$add.entry_state}>"  size = "33" maxlength = "32" id="state" />&nbsp;<span class="alert" id="stText">*</span><input type="hidden" name="zone_id" /><br class="clear" />
            
            <label class="inputLabel" for="postcode"><{T w='Post/Zip Code'}>:</label>
            <input type="text" name="postcode" size = "11" maxlength = "10" id="postcode" value="<{$add.entry_postcode}>" /><span class="alert">*</span><br class="clear" />
            
            <label class="inputLabel" for="country"><{T w='Country'}>:</label>
            <select name="zone_country_id" id="country" >
              <option value=""><{T w='Please Choose Your Country'}></option>
                <{foreach item=item key=key from=$countries}>
                <option value="<{$item.countries_id}>" <{if $item.countries_id eq $add.entry_country_id}> selected="selected"<{/if}>><{$item.countries_name}></option>
              <{/foreach}>
            </select>
            <span class="alert">*</span><br class="clear" />
            
            <label class="inputLabel" for="telephone"><{T w='Telephone'}>:</label>
            <input type="text" name="telephone" size = "11" maxlength = "10" id="telephone" value="<{$add.customers_telephone}>" /><span class="alert">*</span><br class="clear" />

            </fieldset>
            </div>
            <fieldset>
            <legend><{T w='...Or Choose From Your Address Book Entries'}></legend>
            <{foreach item=item key=key from=$addarr}>
            <br class="clear" />
            
            <h3 class="addressBookDefaultName"><input type="radio" name="address" value="<{$item.address_book_id}>" id="name-3" <{if $user.customers_default_address_id eq $item.address_book_id}> checked="checked"<{/if}>/><{$item.customers_firstname}> <{$item.customers_lastname}></h3>
            
            <address><{$item.customers_firstname}> <{$item.customers_lastname}><br /> <{$item.entry_street_address}><{if $item.entry_suburb neq ''}><br /> <{$item.entry_suburb}><{/if}> <br /> <{$item.entry_city}>, <{$item.entry_postcode}><br /> <{$item.entry_state}>, <{$item.entry_country_id}><br /> <{$item.customers_telephone}></address>
            <{/foreach}>
            
            </fieldset>
            
            <div class="buttonRow forward"><input type="hidden" name="s" value="<{$s}>" /><input type="hidden" name="action" value="submit" /><input type="image" src="<{$smarty.const.BASEPATH}>/css/img/button_continue.gif" alt="<{T w='Continue'}>" title=" <{T w='Continue'}> " /></div>
            <div class="buttonRow back"><strong><{T w='Continue'}></strong><br /><{T w='- to shipping method.'}></div>
            
            </form>
            </div>
    </div>
    
</div>  
<{include file="footer.html"}>
</body>
</html>